package org.lw.springbootlw.common.Entity;

import com.fasterxml.jackson.annotation.JsonBackReference;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Department {
    private Long id;
    private String name;
   // @JsonManagedReference   // 防止json序列化时无限递归
   @JsonBackReference
   private List<Employee> employees; // 一对多关系
}
